package com.kyl.controller.customer;


import com.kyl.base.ResponseResult;
import com.kyl.dto.UserLoginRequestDto;
import com.kyl.service.MemberService;
import com.kyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @author WanJl
 * @version 1.0
 * @title CustomerUserController
 * @description 客户管理前端控制器
 * @create 2025/1/13
 */
@Slf4j
@Api("小程序客户管理相关接口")
@RestController
@RequestMapping("/customer/user")
public class CustomerUserController {

    @Resource
    private MemberService memberService;

    @PostMapping("/login")
    @ApiOperation("小程序客户登录")
    public ResponseResult<LoginVo> login(@RequestBody UserLoginRequestDto userLoginRequestDto) throws IOException {
        LoginVo loginVo=  memberService.login(userLoginRequestDto);
        return ResponseResult.success(loginVo);
    }
}
